<?php include 'page.header.inc';
drupal_add_js('http://maps.google.com/maps/api/js?sensor=false', 'external');
?>
<?php if (($latitude) && ($longtitude)) : ?>
<script type="text/javascript">
  var map,
	latLng = new google.maps.LatLng(<?php print $latitude;?>, <?php print $longtitude;?>);
  function initialize() {
    var mapDiv = document.getElementById('map-canvas');
      
    map = new google.maps.Map(mapDiv, {
			center: latLng,
			zoom: 16,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		});
  
    google.maps.event.addListenerOnce(map, 'tilesloaded', addMarkers);
  }
  
  function addMarkers() {
    var bounds = map.getBounds();
    var southWest = bounds.getSouthWest();
    var northEast = bounds.getNorthEast();
    var lngSpan = northEast.lng() - southWest.lng();
    var latSpan = northEast.lat() - southWest.lat();
    var marker = new google.maps.Marker({
			position: latLng,
			map: map
		});
  	<?php if (($contact_title) || ($contact_desc)) : ?>
		var content = '<div style="font-size:11px;width:300px;"><div style="margin-bottom:5px;font-weight:bold;font-size:1.2em;"><?php print $contact_title; ?></div><?php print $contact_desc;?></div>';
		var infowindow = new google.maps.InfoWindow({ content: content});
		infowindow.open(map, marker);
		<?php endif; ?>
  }
  
  google.maps.event.addDomListener(window, 'load', initialize);
</script>
<?php endif; ?>
		<?php if ($messages): ?>
      <div id="messages">
        <?php print $messages; ?>
      </div> <!-- /#messages -->
    <?php endif; ?>
    
		<?php if ($breadcrumb): ?>
      <div id="breadcrumb"><?php print $breadcrumb; ?></div>
    <?php endif; ?>
    <div id="content">      
      <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
      <?php print render($title_prefix); ?>
      <?php if ($title): ?>
        <h1 class="title" id="page-title">
          <?php print $title; ?>
        </h1>
      <?php endif; ?>
      <?php print render($title_suffix); ?>
      <?php if ($tabs): ?>
        <div class="tabs">
          <?php print render($tabs); ?>
        </div>
      <?php endif; ?>
      <?php print render($page['help']); ?>
      <?php if ($action_links): ?>
        <ul class="action-links">
          <?php print render($action_links); ?>
        </ul>
      <?php endif; ?>
      
      <?php if ($contentop_blocks): $x=0; ?>
  	    <div id="contentop-blocks" class="clearfix">
  	      <?php foreach($contenttop_columns[$contentop_blocks] as $col):
  	        $x++;
  	        if($x == 1){ $class = " first"; } else {$class = "";}
  	      ?>
  	        <div class="<?php echo $col.$class; ?>">
  	           <?php print render($page['contentt_'.$x]); ?>
  	        </div>
  	      <?php endforeach; ?>
  	    </div><!-- /#contentop-blocks -->
  	  <?php endif; ?>
    
      <div id="map-canvas"></div>
      <h3><?php print t('Contact form');?></h3>
      <?php print render($page['content']); ?>
    </div><!-- /#content -->
    <?php if ($page['sidebar_first']): ?>
      <div id="sidebar" class="column sidebar">
        <?php print render($page['sidebar_first']); ?>
      </div> <!-- /#sidebar -->
    <?php endif; ?>

    
<?php include 'page.footer.inc'; ?>